﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="News.aspx.cs" Inherits="EXAM.Admin.Page_Admin.News" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .RadUpload .ruInputs
        {
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .RadUpload .ruInputs
        {
            zoom: 1; /*IE fix - removing items on the client*/
        }
        .RadUpload .ruInputs
        {
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .RadUpload .ruInputs
        {
            zoom: 1; /*IE fix - removing items on the client*/
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlacebody" runat="server">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td align="center" class="formTitle">
                News Management
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbErr" runat="server" ForeColor="Red"></asp:Label>
                <table>
                    <tr>
                        <td>
                            Title
                        </td>
                        <td>
                            <telerik:RadTextBox ID="txtTitle" runat="server" Width="300px">
                            </telerik:RadTextBox>
                            <telerik:RadTextBox ID="txtID" runat="server" Visible="False" Width="50px">
                            </telerik:RadTextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Category
                        </td>
                        <td>
                            <telerik:RadComboBox ID="cboCate" runat="server" AllowCustomText="True">
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Short Desc.
                        </td>
                        <td>
                            <telerik:RadTextBox ID="txtSDesc" runat="server" Width="680px">
                            </telerik:RadTextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Descriptn
                        </td>
                        <td>
                            <telerik:RadEditor ID="txtLDesc" runat="server">
                                <Content >
                                </Content>
                                <ImageManager ViewPaths="~/Upload" />
                                <TemplateManager ViewPaths="~/Upload/Templates" SearchPatterns="*.html|*.htm" />
                                <DocumentManager ViewPaths="~/Upload/Documents" SearchPatterns="*.*" />
                                <FlashManager ViewPaths="~/Upload/Flashs" SearchPatterns="*.swf" />
                                <CssClasses >
                                <telerik:EditorCssClass Name="" Value="" /></CssClasses>
                                
                            </telerik:RadEditor>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Image
                        </td>
                        <td>
                            <div style="float: left; width: 300px">
                                <telerik:RadUpload ID="upPicture" runat="server" Width="300px" ControlObjectsVisibility="None"
                                    TargetFolder="~/Upload">
                                </telerik:RadUpload>
                            </div>
                            <div style="float: left;">
                                <asp:Image ID="imgPic" runat="server" Width="80px" Height="80px" /></div>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;Rank
                        </td>
                        <td>
                            <telerik:RadNumericTextBox ID="txtRank" runat="server" Value="0">
                                <NumberFormat DecimalDigits="0" />
                            </telerik:RadNumericTextBox>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Enable
                        </td>
                        <td>
                            <telerik:RadButton ID="ckbStatus" runat="server" ToggleType="CheckBox" ButtonType="LinkButton"
                                AutoPostBack="false">
                                <ToggleStates>
                                    <telerik:RadButtonToggleState Text="Checked" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                                    <telerik:RadButtonToggleState Text="UnChecked" PrimaryIconCssClass="rbToggleCheckbox" />
                                </ToggleStates>
                            </telerik:RadButton>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div style="margin: auto; width: 350px;">
        <telerik:RadButton ID="btnNew" runat="server" Text="Add New" SplitButtonCssClass=""
            SplitButtonPosition="Right" OnClick="btnNew_Click" Width="100px">
        </telerik:RadButton>
        <telerik:RadButton ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"
            Width="100px">
        </telerik:RadButton>
        <telerik:RadButton ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click"
            Width="100px">
        </telerik:RadButton>
    </div>
    <br />
    <br />
    <div style="width: 100%">
        <telerik:RadGrid ID="dgvList" runat="server" AutoGenerateColumns="False" GridLines="None"
            Skin="Office2007" AllowFilteringByColumn="True" AllowMultiRowSelection="True"
            AllowPaging="True" AllowSorting="True" OnItemCommand="dgvList_ItemCommand" ShowGroupPanel="True"
            OnNeedDataSource="dgvList_NeedDataSource">
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007">
            </HeaderContextMenu>
            <MasterTableView PageSize="20" DataKeyNames="ID">
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridButtonColumn CommandName="Selected" FilterControlAltText="Filter column column"
                        Text="Edit" UniqueName="column3">
                    </telerik:GridButtonColumn>
                    <telerik:GridClientSelectColumn FilterControlAltText="Filter column column" UniqueName="column8">
                    </telerik:GridClientSelectColumn>
                    <telerik:GridBoundColumn FilterControlAltText="Filter column1 column" HeaderText="Title"
                        UniqueName="column1" DataField="Title">
                    </telerik:GridBoundColumn>
                    <telerik:GridImageColumn DataImageUrlFields="Image" DataImageUrlFormatString="~/Upload/{0}"
                        FilterControlAltText="Filter column column" HeaderText="Image" ImageHeight="80px"
                        ImageWidth="80px" UniqueName="column6">
                    </telerik:GridImageColumn>
                    <telerik:GridBoundColumn FilterControlAltText="Filter column2 column" HeaderText="Category"
                        UniqueName="column2" DataField="Category">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="CreateDay" FilterControlAltText="Filter column4 column"
                        HeaderText="Create(yyyyMMdd)" UniqueName="column4">
                        <ItemTemplate>
                            <asp:Label ID="CreateDayLabel" runat="server" Text='<%# SUNDateString(Eval("CreateDay").ToString()) %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="IDStatus" FilterControlAltText="Filter column column"
                        HeaderText="Status" UniqueName="column" ReadOnly="true">
                        <EditItemTemplate>
                            <asp:TextBox ID="IDStatusTextBox" runat="server" Text='<%# Bind("IDStatus") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="IDStatusLabel" runat="server" Enabled="false" Checked='<%# Eval("IDStatus").ToString()=="1" %>'>
                            </asp:CheckBox>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="Rank" FilterControlAltText="Filter column column"
                        HeaderText="Rank" UniqueName="column5">
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings AllowDragToGroup="True">
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
    </div>
    <br />
</asp:Content>
